use crate::models::TodoItem;
//use gloo::console;
use stylist::yew::styled_component;
use web_sys::wasm_bindgen::JsCast;
use web_sys::Event;
use yew::{classes, html, Callback, Html, Properties};

#[derive(Properties, Clone, PartialEq)]
pub struct ItemButtonsContainerComponentProps {
    //pub on_edit_click: Callback<String>,
}

#[styled_component]
pub fn ItemButtonsContainerComponent(props: &ItemButtonsContainerComponentProps) -> Html {
    /*
    let handle_click = {
        let on_status_changed = props.on_status_changed.clone();
        let id = props.data.id.clone();
        Callback::from(move |e: Event| {
            if let Some(element) = e
                .target()
                .map(|item| item.dyn_into::<web_sys::HtmlInputElement>())
            {
                //console::log!("new status:{}", element.clone().expect("element").checked());
                let checked = element.expect("checked element").checked();
                on_status_changed.emit((id.clone(), checked))
            }
        })
    };
    let handle_edit = {
        let on_edit_click = props.on_edit_click.clone();
        let id = props.data.id.clone();
        Callback::from(move |_| on_edit_click.emit(id.clone()))
    };

    let should_render_button = !&props.data.finished;
    */

    html! {
        <div class={classes!("padding-small",css!(r#""#))}>
            <div class="padding-small">
            </div>
        </div>
    }
}
